from pydantic import BaseModel
from typing import Optional

class AccountWechatsBase(BaseModel):
    uniacid: int
    token: str
    encodingaeskey: str
    level: int
    name: str
    account: str
    original: str
    signature: str
    country: str
    province: str
    city: str
    username: str
    password: str
    lastupdate: int
    key: str
    secret: str
    styleid: int
    subscribeurl: str
    auth_refresh_token: str

class AccountWechatsCreate(AccountWechatsBase):
    pass

class AccountWechatsUpdate(BaseModel):
    token: Optional[str]
    encodingaeskey: Optional[str]
    

class AccountWechats(AccountWechatsBase):
    acid: int

    class Config:
        from_attributes = True





class AccountAliappBase(BaseModel):
    uniacid: int
    level: int
    name: str
    description: str
    key: str

class AccountAliappCreate(AccountAliappBase):
    pass

class AccountAliappUpdate(BaseModel):
    level: Optional[int]
    name: Optional[str]
    description: Optional[str]
    key: Optional[str]

class AccountAliappRead(AccountAliappBase):
    acid: int

    class Config:
        from_attributes = True

class AccountBaiduappBase(BaseModel):
    uniacid: int
    name: str
    appid: str
    key: str
    secret: str
    description: str

class AccountBaiduappCreate(AccountBaiduappBase):
    pass

class AccountBaiduappUpdate(BaseModel):
    name: Optional[str]
    appid: Optional[str]
    key: Optional[str]
    secret: Optional[str]
    description: Optional[str]

class AccountBaiduappRead(AccountBaiduappBase):
    acid: int

    class Config:
        from_attributes = True


class AccountPhoneappBase(BaseModel):
    uniacid: int
    name: str

class AccountPhoneappCreate(AccountPhoneappBase):
    pass

class AccountPhoneappUpdate(BaseModel):
    name: Optional[str]

class AccountPhoneappRead(AccountPhoneappBase):
    acid: int

    class Config:
        from_attributes = True

class AccountToutiaoappBase(BaseModel):
    uniacid: int
    name: str
    appid: str
    key: str
    secret: str
    description: str

class AccountToutiaoappCreate(AccountToutiaoappBase):
    pass

class AccountToutiaoappUpdate(BaseModel):
    name: Optional[str]
    appid: Optional[str]
    key: Optional[str]
    secret: Optional[str]
    description: Optional[str]

class AccountToutiaoappRead(AccountToutiaoappBase):
    acid: int

    class Config:
        from_attributes = True



class AccountBase(BaseModel):
    uniacid: int
    hash: str
    type: int
    isconnect: int
    isdeleted: int
    endtime: int
    send_account_expire_status: int
    send_api_expire_status: int

class AccountCreate(AccountBase):
    pass

class AccountUpdate(AccountBase):
    pass

class Account(AccountBase):
    acid: int
    
    class Config:
        from_attributes = True





class AccountWebappBase(BaseModel):
    uniacid: Optional[int]
    name: Optional[str]

class AccountWebappCreate(AccountWebappBase):
    pass

class AccountWebappUpdate(AccountWebappBase):
    pass

class AccountWebapp(AccountWebappBase):
    acid: int

    class Config:
        from_attributes = True

class AccountWxappBase(BaseModel):
    uniacid: int
    token: str
    encodingaeskey: str
    level: int
    account: str
    original: str
    key: str
    secret: str
    name: str
    appdomain: str
    auth_refresh_token: Optional[str]

class AccountWxappCreate(AccountWxappBase):
    pass

class AccountWxappUpdate(BaseModel):
    token: Optional[str]
    encodingaeskey: Optional[str]
    level: Optional[int]
    account: Optional[str]
    original: Optional[str]
    key: Optional[str]
    secret: Optional[str]
    name: Optional[str]
    appdomain: Optional[str]
    auth_refresh_token: Optional[str]

class AccountWxappRead(AccountWxappBase):
    acid: int

    class Config:
        from_attributes = True

class AccountXzappBase(BaseModel):
    uniacid: int
    name: str
    original: str
    lastupdate: int
    styleid: int
    createtime: int
    token: str
    encodingaeskey: str
    xzapp_id: str
    level: int
    key: str
    secret: str

class AccountXzappCreate(AccountXzappBase):
    pass

class AccountXzappUpdate(BaseModel):
    name: Optional[str]
    original: Optional[str]
    lastupdate: Optional[int]
    styleid: Optional[int]
    token: Optional[str]
    encodingaeskey: Optional[str]
    xzapp_id: Optional[str]
    level: Optional[int]
    key: Optional[str]
    secret: Optional[str]

class AccountXzappRead(AccountXzappBase):
    acid: int

    class Config:
        from_attributes = True